import { ACTION_TYPE } from '@/enum/message';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';

@Entity('communication_infomation')
export class CommunicationInformation extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '主键，自增',
  })
  id: number;

  @Column({
    type: 'int',
    name: 'action_type',
    comment: `
      互动类型，
      1表示别人给你点赞
      2表示别人给你评论
      3表示别人给你回复
    `,
  })
  actionType: ACTION_TYPE;

  @Column({
    type: 'int',
    name: 'action_user_id',
    comment: '触发这个互动消息的人的id',
  })
  actionUserId: number;

  @Column({
    type: 'varchar',
    name: 'action_user_nickname',
    comment: '触发这个互动消息的人的用户的昵称',
  })
  actionUserNickname: string;

  @Column({
    type: 'text',
    name: 'action_user_avatar_url',
    comment: '触发这个互动消息的人的用户的头像地址',
  })
  actionUserAvatarUrl: string;

  @Column({
    type: 'int',
    name: 'target_user_id',
    comment: '需要广播的用户的id',
  })
  targetUserId: number;

  @Column({
    type: 'varchar',
    name: 'target_user_nickname',
    comment: '需要广播的用户的昵称',
  })
  targetUserNickname: string;

  @Column({
    type: 'text',
    name: 'target_user_avatar_url',
    comment: '需要广播的用户的头像地址',
  })
  targetUserAvatarUrl: string;

  @Column({
    type: 'int',
    name: 'message_id',
    comment: '需要广播的信息的id（tyep是什么它就是什么类型的id）',
  })
  messageId: number;

  @Column({
    type: 'varchar',
    name: 'message',
    comment: '希望对方的目',
  })
  message: string;
}
